<template>
  <view :class="'background '+$store.state.account.addAccountVirtualCardList.extraClass"
        v-if="$store.state.account.addAccountVirtualCardList.show">
    <view class="page-container-add-account-choose-list">
      <view class="header-section">
        <view class="back" @click="goBack">
          返回
        </view>
        <view class="header-section-title">
          添加虚拟账户
        </view>
        <view class="close" @click="goBack">
          x
        </view>

      </view>
      <view class="body-section">

        <ul >
          <li v-for="(item, index) in list" :key="index" @click="e=>openForm(item)">
            <view class="left-side">
              <view class="icon-box">
                <svg-icon :icon="item.name" :width="30" :height="30"></svg-icon>
              </view>
              <view class="span-box">
                <span>{{item.name}}</span>
              </view>
            </view>
            <view class="right-side">
              <view class="right-arrow">
              </view>
            </view>

          </li>
        </ul>

      </view>

    </view>

  </view>
</template>

<script>

import {mapState} from "vuex";

import SvgIcon from "@/pages/svg-icon.vue";
export default {
  components: {SvgIcon},
  data() {
    return {
      list:[
        {name:'支付宝'}  ,
        {name:'微信'}  ,
        {name:'虚拟账户'}  ,
      ],
    }

  },
  methods: {
    openForm(item){

      console.log(item)
      this.$store.dispatch("ENTER_ADD_ACCOUNT_VIRTUAL_CARD_FORM_PAGE")

    },
    goBack() {
      this.$store.dispatch("LEAVE_ADD_ACCOUNT_VIRTUAL_CARD_LIST_PAGE")
    }

  },

}
</script>


<style scoped>

.background {
  //width: 100vw;
  //height: 100vh;
  background: #f2f2f6;
  position: absolute;
  left: 0;
  bottom: 0;
  top: 0;
  right: 0;
  z-index: 1000 !important;
}

.background-animation-none {
  left: 100%;
}

.background-animation-enter {

  animation-name: hd-enter;
  animation-duration: 300ms;
}

.background-animation-leave {

  animation-name: hd-leave;
  animation-duration: 300ms;
  left: 100%;
}

@keyframes hd-enter {
  0% {
    left: 100%;
  }
  100% {
    left: 0
  }
}

@keyframes hd-leave {
  0% {
    left: 0;
  }
  100% {
    left: 100%;
  }
}

.page-container-add-account-choose-list {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: scroll;

}

.page-container-add-account-choose-list .header-section {
  background: pink;
  min-height: 50px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.page-container-add-account-choose-list .header-section .back {
  width: 40px;
  margin-left: 20px;
  position: relative;
}

.page-container-add-account-choose-list .header-section .back::before {
  content: "";
  width: 12px !important;
  height: 12px !important;
  border-top: 2px solid #000;
  border-right: 2px solid #000;
  transform: rotate(225deg);
  position: absolute;
  top: 4px;
  left: -11px;
}

.page-container-add-account-choose-list  .close {
  width: 40px;
  margin-right: 20px;
  text-align: right;
}


.page-container-add-account-choose-list ul {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  width: 100%;
  //background: red;

}

.page-container-add-account-choose-list ul li {
  list-style: none;
  height: 60px;
  font-size: 20px;
  border-bottom: 1px solid rgb(245, 245, 245);
  display: flex;
  flex-direction: row;

  width: 100%;
}

.page-container-add-account-choose-list .left-side {
  display: flex;
  flex-direction: row;
  align-items: center;

}
.page-container-add-account-choose-list .body-section{
  background: #fff;
  margin-top: 10px;
}
.page-container-add-account-choose-list .body-section .left-side .icon-box {
  margin-left: 20px;

}

.page-container-add-account-choose-list .body-section .left-side .span-box {
  margin-left: 12px;
}

.page-container-add-account-choose-list .body-section .right-side {
  position: relative;
  flex: 1;

}

.page-container-add-account-choose-list .body-section .right-side .right-arrow {

  content: "";
  width: 10px !important;
  height: 10px !important;
  border-top: 2px solid #aaa;
  border-right: 2px solid #aaa;
  transform: rotate(45deg);
  position: absolute;
  top:25px;
  right: 16px;


}
</style>
